home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / xemacs.info-7 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  49.4 KB  |  1,164 lines

  1. This is Info file ../../info/xemacs.info, produced by Makeinfo-1.63
  2. from the input file xemacs.texi.
  3.  
  4.    This file documents the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  17. General Public License" are included exactly as in the original, and
  18. provided that the entire resulting derived work is distributed under the
  19. terms of a permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "The GNU Manifesto",
  24. "Distribution" and "GNU General Public License" may be included in a
  25. translation approved by the author instead of in the original English.
  26.  
  27. 
  28. File: xemacs.info,  Node: Recover,  Prev: Auto Save Control,  Up: Auto Save
  29.  
  30. Recovering Data from Auto-Saves
  31. -------------------------------
  32.  
  33.    If you want to use the contents of an auto-save file to recover from
  34. a loss of data, use the command `M-x recover-file RET FILE RET'.  Emacs
  35. visits FILE and then (after your confirmation) restores the contents
  36. from the auto-save file `#FILE#'.  You can then save the file with `C-x
  37. C-s' to put the recovered text into FILE itself.  For example, to
  38. recover file `foo.c' from its auto-save file `#foo.c#', do:
  39.  
  40.      M-x recover-file RET foo.c RET
  41.      C-x C-s
  42.  
  43.    Before asking for confirmation, `M-x recover-file' displays a
  44. directory listing describing the specified file and the auto-save file,
  45. so you can compare their sizes and dates.  If the auto-save file is
  46. older, `M-x recover-file' does not offer to read it.
  47.  
  48.    Auto-saving is disabled by `M-x recover-file' because using this
  49. command implies that the auto-save file contains valuable data from a
  50. past session.  If you save the data in the visited file and then go on
  51. to make new changes, turn auto-saving back on with `M-x auto-save-mode'.
  52.  
  53. 
  54. File: xemacs.info,  Node: Version Control,  Next: ListDir,  Prev: Auto Save,  Up: Files
  55.  
  56. Version Control
  57. ===============
  58.  
  59.    "Version control systems" are packages that can record multiple
  60. versions of a source file, usually storing the unchanged parts of the
  61. file just once.  Version control systems also record history information
  62. such as the creation time of each version, who created it, and a
  63. description of what was changed in that version.
  64.  
  65.    The GNU project recommends the version control system known as RCS,
  66. which is free software and available from the Free Software Foundation.
  67. Emacs supports use of either RCS or SCCS (a proprietary, but widely
  68. used, version control system that is not quite as powerful as RCS)
  69. through a facility called VC.  The same Emacs commands work with either
  70. RCS or SCCS, so you hardly have to know which one of them you are using.
  71.  
  72. * Menu:
  73.  
  74. * Concepts of VC::              Basic version control information;
  75.                                   checking files in and out.
  76. * Editing with VC::             Commands for editing a file maintained
  77.                                   with version control.
  78. * Variables for Check-in/out::  Variables that affect the commands used
  79.                                   to check files in or out.
  80. * Log Entries::                 Logging your changes.
  81. * Change Logs and VC::          Generating a change log file from log
  82.                                   entries.
  83. * Old Versions::                Examining and comparing old versions.
  84. * VC Status::                   Commands to view the VC status of files and
  85.                                   look at log entries.
  86. * Renaming and VC::             A command to rename both the source and
  87.                                   master file correctly.
  88. * Snapshots::                   How to make and use snapshots, a set of
  89.                                   file versions that can be treated as a unit.
  90. * Version Headers::             Inserting version control headers into
  91.                                   working files.
  92.  
  93. 
  94. File: xemacs.info,  Node: Concepts of VC,  Next: Editing with VC,  Prev: Version Control,  Up: Version Control
  95.  
  96. Concepts of Version Control
  97. ---------------------------
  98.  
  99.    When a file is under version control, we also say that it is
  100. "registered" in the version control system.  Each registered file has a
  101. corresponding "master file" which represents the file's present state
  102. plus its change history, so that you can reconstruct from it either the
  103. current version or any specified earlier version.  Usually the master
  104. file also records a "log entry" for each version describing what was
  105. changed in that version.
  106.  
  107.    The file that is maintained under version control is sometimes called
  108. the "work file" corresponding to its master file.
  109.  
  110.    To examine a file, you "check it out".  This extracts a version of
  111. the source file (typically, the most recent) from the master file.  If
  112. you want to edit the file, you must check it out "locked".  Only one
  113. user can do this at a time for any given source file.  (This kind of
  114. locking is completely unrelated to the locking that Emacs uses to
  115. detect simultaneous editing of a file.)
  116.  
  117.    When you are done with your editing, you must "check in" the new
  118. version.  This records the new version in the master file, and unlocks
  119. the source file so that other people can lock it and thus modify it.
  120.  
  121.    Checkin and checkout are the basic operations of version control.
  122. You can do both of them with a single Emacs command: `C-x C-q'
  123. (`vc-toggle-read-only').
  124.  
  125.    A "snapshot" is a coherent collection of versions of the various
  126. files that make up a program.  *Note Snapshots::.
  127.  
  128. 
  129. File: xemacs.info,  Node: Editing with VC,  Next: Variables for Check-in/out,  Prev: Concepts of VC,  Up: Version Control
  130.  
  131. Editing with Version Control
  132. ----------------------------
  133.  
  134.    When you visit a file that is maintained using version control, the
  135. mode line displays `RCS' or `SCCS' to inform you that version control
  136. is in use, and also (in case you care) which low-level system the file
  137. is actually stored in.  Normally, such a source file is read-only, and
  138. the mode line indicates this with `%%'.  With RCS, the mode line also
  139. indicates the number of the head version, which is normally also the
  140. version you are looking at.
  141.  
  142.    These are the commands for editing a file maintained with version
  143. control:
  144.  
  145. `C-x C-q'
  146.      Check the visited file in or out.
  147.  
  148. `C-x v u'
  149.      Revert the buffer and the file to the last checked in version.
  150.  
  151. `C-x v c'
  152.      Remove the last-entered change from the master for the visited
  153.      file.  This undoes your last check-in.
  154.  
  155. `C-x v i'
  156.      Register the visited file in version control.
  157.  
  158. (`C-x v' is the prefix key for version control commands; all of these
  159. commands except for `C-x C-q' start with `C-x v'.)
  160.  
  161.    When you want to modify a file maintained with version control, type
  162. `C-x C-q' (`vc-toggle-read-only').  This "checks out" the file, and
  163. tells RCS or SCCS to lock the file.  This means making the file
  164. writable for you (but not for anyone else).
  165.  
  166.    When you are finished editing the file, type `C-x C-q' again.  When
  167. used on a file that is checked out, this command checks the file in.
  168. But check-in does not start immediately; first, you must enter the "log
  169. entry"--a description of the changes in the new version.  `C-x C-q'
  170. pops up a buffer for you to enter this in.  When you are finished
  171. typing in the log entry, type `C-c C-c' to terminate it; this is when
  172. actual check-in takes place.
  173.  
  174.    Once you have checked in your changes, the file is unlocked, so that
  175. other users can lock it and modify it.
  176.  
  177.    Emacs does not save backup files for source files that are maintained
  178. with version control.  If you want to make backup files despite version
  179. control, set the variable `vc-make-backup-files' to a non-`nil' value.
  180.  
  181.    Normally the work file exists all the time, whether it is locked or
  182. not.  If you set `vc-keep-workfiles' to `nil', then checking in a new
  183. version with `C-x C-q' deletes the work file; but any attempt to visit
  184. the file with Emacs creates it again.
  185.  
  186.    It is not impossible to lock a file that someone else has locked.  If
  187. you try to check out a file that is locked, `C-x C-q' asks you whether
  188. you want to "steal the lock."  If you say yes, the file becomes locked
  189. by you, but a message is sent to the person who had formerly locked the
  190. file, to inform him of what has happened.  The mode line indicates that
  191. a file is locked by someone else by displaying the login name of that
  192. person, before the version number.
  193.  
  194.    If you want to discard your current set of changes and revert to the
  195. last version checked in, use `C-x v u' (`vc-revert-buffer').  This
  196. cancels your last check-out, leaving the file unlocked.  If you want to
  197. make a different set of changes, you must first check the file out
  198. again.  `C-x v u' requires confirmation, unless it sees that you
  199. haven't made any changes since the last checked-in version.
  200.  
  201.    `C-x v u' is also the command to use if you lock a file and then
  202. don't actually change it.
  203.  
  204.    You can cancel a change after checking it in, with `C-x v c'
  205. (`vc-cancel-version').  This command discards all record of the most
  206. recent checked in version, so be careful about using it.  It requires
  207. confirmation with `yes'.  By default, `C-x v c' reverts your workfile
  208. and buffer to the previous version (the one that precedes the version
  209. that is deleted), but you can prevent the reversion by giving the
  210. command a prefix argument.  Then the buffer does not change.
  211.  
  212.    This command with a prefix argument is useful when you have checked
  213. in a change and then discover a trivial error in it; you can cancel the
  214. erroneous check-in, fix the error, and repeat the check-in.
  215.  
  216.    Be careful when invoking `C-x v c', as it is easy to throw away a
  217. lot of work with it.  To help you be careful, this command always
  218. requires confirmation with `yes'.
  219.  
  220.    You can register the visited file for version control using
  221. `C-x v i' (`vc-register').  If the variable `vc-default-back-end' is
  222. non-`nil', it specifies which version control system to use; otherwise,
  223. this uses RCS if it is installed on your system and SCCS if not.  After
  224. `C-x v i', the file is unlocked and read-only.  Type `C-x C-q' if you
  225. wish to edit it.
  226.  
  227.    By default, the initial version number is 1.1.  If you want to use a
  228. different number, give `C-x v i' a prefix argument; then it reads the
  229. initial version number using the minibuffer.
  230.  
  231.    If `vc-initial-comment' is non-`nil', `C-x v i' reads an initial
  232. comment (much like a log entry) to describe the purpose of this source
  233. file.
  234.  
  235.    To specify the version number for a subsequent checkin, use the
  236. command `C-u C-x v v'.  `C-x v v' (`vc-next-action') is the command
  237. that `C-x C-q' uses to do the "real work" when the visited file uses
  238. version control.  When used for checkin, and given a prefix argument,
  239. it reads the version number with the minibuffer.
  240.  
  241. 
  242. File: xemacs.info,  Node: Variables for Check-in/out,  Next: Log Entries,  Prev: Editing with VC,  Up: Version Control
  243.  
  244. Variables Affecting Check-in and Check-out
  245. ------------------------------------------
  246.  
  247.    If `vc-suppress-confirm' is non-`nil', then `C-x C-q' and `C-x v i'
  248. can save the current buffer without asking, and `C-x v u' also operates
  249. without asking for confirmation.  (This variable does not affect `C-x v
  250. c'; that is so drastic that it should always ask for confirmation.)
  251.  
  252.    VC mode does much of its work by running the shell commands for RCS
  253. and SCCS.  If `vc-command-messages' is non-`nil', VC displays messages
  254. to indicate which shell commands it runs, and additional messages when
  255. the commands finish.
  256.  
  257.    Normally, VC assumes that it can deduce the locked/unlocked state of
  258. files by looking at the file permissions of the work file; this is
  259. fast.  However, if the `RCS' or `SCCS' subdirectory is actually a
  260. symbolic link, then VC does not trust the file permissions to reflect
  261. this status.
  262.  
  263.    You can specify the criterion for whether to trust the file
  264. permissions by setting the variable `vc-mistrust-permissions'.  Its
  265. value may be `t' (always mistrust the file permissions and check the
  266. master file), `nil' (always trust the file permissions), or a function
  267. of one argument which makes the decision.  The argument is the directory
  268. name of the `RCS' or `SCCS' subdirectory.  A non-`nil' value from the
  269. function says to mistrust the file permissions.
  270.  
  271.    If you find that the file permissions of work files are changed
  272. erroneously, set `vc-mistrust-permissions' to `t'.  Then VC always
  273. checks the master file to determine the file's status.
  274.  
  275.    You can specify additional directories to search for version control
  276. programs by setting the variable `vc-path'.  These directories are
  277. searched before the usual search path.  The proper result usually
  278. happens automatically.
  279.  
  280. 
  281. File: xemacs.info,  Node: Log Entries,  Next: Change Logs and VC,  Prev: Variables for Check-in/out,  Up: Version Control
  282.  
  283. Log Entries
  284. -----------
  285.  
  286.    When you're editing an initial comment or log entry for inclusion in
  287. a master file, finish your entry by typing `C-c C-c'.
  288.  
  289. `C-c C-c'
  290.      Finish the comment edit normally (`vc-finish-logentry').  This
  291.      finishes check-in.
  292.  
  293.    To abort check-in, just don't type `C-c C-c' in that buffer.  You
  294. can switch buffers and do other editing.  As long as you don't try to
  295. check in another file, the entry you were editing remains in its
  296. buffer, and you can go back to that buffer at any time to complete the
  297. check-in.
  298.  
  299.    If you change several source files for the same reason, it is often
  300. convenient to specify the same log entry for many of the files.  To do
  301. this, use the history of previous log entries.  The commands `M-n',
  302. `M-p', `M-s' and `M-r' for doing this work just like the minibuffer
  303. history commands (except that these versions are used outside the
  304. minibuffer).
  305.  
  306.    Each time you check in a file, the log entry buffer is put into VC
  307. Log mode, which involves running two hooks: `text-mode-hook' and
  308. `vc-log-mode-hook'.
  309.  
  310. 
  311. File: xemacs.info,  Node: Change Logs and VC,  Next: Old Versions,  Prev: Log Entries,  Up: Version Control
  312.  
  313. Change Logs and VC
  314. ------------------
  315.  
  316.    If you use RCS for a program and also maintain a change log file for
  317. it (*note Change Log::.), you can generate change log entries
  318. automatically from the version control log entries:
  319.  
  320. `C-x v a'
  321.      Visit the current directory's change log file and create new
  322.      entries for versions checked in since the most recent entry in the
  323.      change log file (`vc-update-change-log').
  324.  
  325.      This command works with RCS only; it does not work with SCCS.
  326.  
  327.    For example, suppose the first line of `ChangeLog' is dated 10 April
  328. 1992, and that the only check-in since then was by Nathaniel Bowditch
  329. to `rcs2log' on 8 May 1992 with log text `Ignore log messages that
  330. start with `#'.'.  Then `C-x v a' visits `ChangeLog' and inserts text
  331. like this:
  332.  
  333.      Fri May  8 21:45:00 1992  Nathaniel Bowditch  (nat@apn.org)
  334.      
  335.              * rcs2log: Ignore log messages that start with `#'.
  336.  
  337. You can then edit the new change log entry further as you wish.
  338.  
  339.    Normally, the log entry for file `foo' is displayed as `* foo: TEXT
  340. OF LOG ENTRY'.  The `:' after `foo' is omitted if the text of the log
  341. entry starts with `(FUNCTIONNAME): '.  For example, if the log entry
  342. for `vc.el' is `(vc-do-command): Check call-process status.', then the
  343. text in `ChangeLog' looks like this:
  344.  
  345.      Wed May  6 10:53:00 1992  Nathaniel Bowditch  (nat@apn.org)
  346.      
  347.              * vc.el (vc-do-command): Check call-process status.
  348.  
  349.    When `C-x v a' adds several change log entries at once, it groups
  350. related log entries together if they all are checked in by the same
  351. author at nearly the same time.  If the log entries for several such
  352. files all have the same text, it coalesces them into a single entry.
  353. For example, suppose the most recent checkins have the following log
  354. entries:
  355.  
  356. For `vc.texinfo':
  357.      Fix expansion typos.
  358. For `vc.el':
  359.      Don't call expand-file-name.
  360. For `vc-hooks.el':
  361.      Don't call expand-file-name.
  362.  
  363.    They appear like this in `ChangeLog':
  364.  
  365.      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  366.      
  367.              * vc.texinfo: Fix expansion typos.
  368.      
  369.              * vc.el, vc-hooks.el: Don't call expand-file-name.
  370.  
  371.    Normally, `C-x v a' separates log entries by a blank line, but you
  372. can mark several related log entries to be clumped together (without an
  373. intervening blank line) by starting the text of each related log entry
  374. with a label of the form `{CLUMPNAME} '.  The label itself is not
  375. copied to `ChangeLog'.  For example, suppose the log entries are:
  376.  
  377. For `vc.texinfo':
  378.      {expand} Fix expansion typos.
  379. For `vc.el':
  380.      {expand} Don't call expand-file-name.
  381. For `vc-hooks.el':
  382.      {expand} Don't call expand-file-name.
  383.  
  384. Then the text in `ChangeLog' looks like this:
  385.  
  386.      Wed Apr  1 08:57:59 1992  Nathaniel Bowditch  (nat@apn.org)
  387.      
  388.              * vc.texinfo: Fix expansion typos.
  389.              * vc.el, vc-hooks.el: Don't call expand-file-name.
  390.  
  391.    A log entry whose text begins with `#' is not copied to `ChangeLog'.
  392. For example, if you merely fix some misspellings in comments, you can
  393. log the change with an entry beginning with `#' to avoid putting such
  394. trivia into `ChangeLog'.
  395.  
  396. 
  397. File: xemacs.info,  Node: Old Versions,  Next: VC Status,  Prev: Change Logs and VC,  Up: Version Control
  398.  
  399. Examining And Comparing Old Versions
  400. ------------------------------------
  401.  
  402. `C-x v ~ VERSION RET'
  403.      Examine version VERSION of the visited file, in a buffer of its
  404.      own (`vc-version-other-window').
  405.  
  406. `C-x v ='
  407.      Compare the current buffer contents with the latest checked-in
  408.      version of the file.
  409.  
  410. `C-u C-x v = FILE RET OLDVERS RET NEWVERS RET'
  411.      Compare the specified two versions of FILE.
  412.  
  413.    You can examine any version of a file by first visiting it, and then
  414. using `C-x v ~ VERSION RET' (`vc-version-other-window').  This puts the
  415. text of version VERSION in a file named `FILENAME.~VERSION~', then
  416. visits it in a separate window.
  417.  
  418.    To compare two versions of a file, use the command `C-x v ='
  419. (`vc-diff').
  420.  
  421.    Plain `C-x v =' compares the current buffer contents (saving them in
  422. the file if necessary) with the last checked-in version of the file.
  423. With a prefix argument, `C-x v =' reads a file name and two version
  424. numbers, then compares those versions of the specified file.
  425.  
  426.    If you supply a directory name instead of the name of a work file,
  427. this command compares the two specified versions of all registered files
  428. in that directory and its subdirectories.  You can also specify a
  429. snapshot name (*note Snapshots::.) instead of one or both version
  430. numbers.
  431.  
  432.    You can specify a checked-in version by its number; you can specify
  433. the most recent checked-in version with an empty version number.
  434.  
  435.    This command works by running the `diff' utility, getting the
  436. options from the variable `diff-switches'.  It displays the output in a
  437. special buffer in another window.  Unlike the `M-x diff' command, `C-x
  438. v =' does not try to find the changes in the old and new versions.
  439. This is because one or both versions normally do not exist as files.
  440. They exist only in the records of the master file.  *Note Comparing
  441. Files::, for more information about `M-x diff'.
  442.  
  443. 
  444. File: xemacs.info,  Node: VC Status,  Next: Renaming and VC,  Prev: Old Versions,  Up: Version Control
  445.  
  446. VC Status Commands
  447. ------------------
  448.  
  449.    To view the detailed version control status and history of a file,
  450. type `C-x v l' (`vc-print-log').  It displays the history of changes to
  451. the current file, including the text of the log entries.  The output
  452. appears in a separate window.
  453.  
  454.    When you are working on a large program, it's often useful to find
  455. all the files that are currently locked, or all the files maintained in
  456. version control at all.  You can use `C-x v d' (`vc-directory') to show
  457. all the locked files in or beneath the current directory.  This
  458. includes all files that are locked by any user.  `C-u C-x v d' lists
  459. all files in or beneath the current directory that are maintained with
  460. version control.
  461.  
  462.    The list of files is displayed as a buffer that uses an augmented
  463. Dired mode.  The names of the users locking various files are shown (in
  464. parentheses) in place of the owner and group.  All the normal Dired
  465. commands work in this buffer.  Most interactive VC commands work also,
  466. and apply to the file name on the current line.
  467.  
  468.    The `C-x v v' command (`vc-next-action'), when used in the augmented
  469. Dired buffer, operates on all the marked files (or the file on the
  470. current line).  If it operates on more than one file, it handles each
  471. file according to its current state; thus, it may check out one file
  472. and check in another (because it is already checked out).  If it has to
  473. check in any files, it reads a single log entry, then uses that text
  474. for all the files being checked in.  This can be convenient for
  475. registering or checking in several files at once, as part of the same
  476. change.
  477.  
  478. 
  479. File: xemacs.info,  Node: Renaming and VC,  Next: Snapshots,  Prev: VC Status,  Up: Version Control
  480.  
  481. Renaming VC Work Files and Master Files
  482. ---------------------------------------
  483.  
  484.    When you rename a registered file, you must also rename its master
  485. file correspondingly to get proper results.  Use `vc-rename-file' to
  486. rename the source file as you specify, and rename its master file
  487. accordingly.  It also updates any snapshots (*note Snapshots::.) that
  488. mention the file, so that they use the new name; despite this, the
  489. snapshot thus modified may not completely work (*note Snapshot
  490. Caveats::.).
  491.  
  492.    You cannot use `vc-rename-file' on a file that is locked by someone
  493. else.
  494.  
  495. 
  496. File: xemacs.info,  Node: Snapshots,  Next: Version Headers,  Prev: Renaming and VC,  Up: Version Control
  497.  
  498. Snapshots
  499. ---------
  500.  
  501.    A "snapshot" is a named set of file versions (one for each
  502. registered file) that you can treat as a unit.  One important kind of
  503. snapshot is a "release", a (theoretically) stable version of the system
  504. that is ready for distribution to users.
  505.  
  506. * Menu:
  507.  
  508. * Making Snapshots::        The snapshot facilities.
  509. * Snapshot Caveats::        Things to be careful of when using snapshots.
  510.  
  511. 
  512. File: xemacs.info,  Node: Making Snapshots,  Next: Snapshot Caveats,  Prev: Snapshots,  Up: Snapshots
  513.  
  514. Making and Using Snapshots
  515. ..........................
  516.  
  517.    There are two basic commands for snapshots; one makes a snapshot
  518. with a given name, the other retrieves a named snapshot.
  519.  
  520. `C-x v s NAME RET'
  521.      Define the last saved versions of every registered file in or
  522.      under the current directory as a snapshot named NAME
  523.      (`vc-create-snapshot').
  524.  
  525. `C-x v r NAME RET'
  526.      Check out all registered files at or below the current directory
  527.      level using whatever versions correspond to the snapshot NAME
  528.      (`vc-retrieve-snapshot').
  529.  
  530.      This command reports an error if any files are locked at or below
  531.      the current directory, without changing anything; this is to avoid
  532.      overwriting work in progress.
  533.  
  534.    A snapshot uses a very small amount of resources--just enough to
  535. record the list of file names and which version belongs to the
  536. snapshot.  Thus, you need not hesitate to create snapshots whenever
  537. they are useful.
  538.  
  539.    You can give a snapshot name as an argument to `C-x v =' or `C-x v
  540. ~' (*note Old Versions::.).  Thus, you can use it to compare a snapshot
  541. against the current files, or two snapshots against each other, or a
  542. snapshot against a named version.
  543.  
  544. 
  545. File: xemacs.info,  Node: Snapshot Caveats,  Prev: Making Snapshots,  Up: Snapshots
  546.  
  547. Snapshot Caveats
  548. ................
  549.  
  550.    VC's snapshot facilities are modeled on RCS's named-configuration
  551. support.  They use RCS's native facilities for this, so under VC
  552. snapshots made using RCS are visible even when you bypass VC.
  553.  
  554.    For SCCS, VC implements snapshots itself.  The files it uses contain
  555. name/file/version-number triples.  These snapshots are visible only
  556. through VC.
  557.  
  558.    A snapshot is a set of checked-in versions.  So make sure that all
  559. the files are checked in and not locked when you make a snapshot.
  560.  
  561.    File renaming and deletion can create some difficulties with
  562. snapshots.  This is not a VC-specific problem, but a general design
  563. issue in version control systems that no one has solved very well yet.
  564.  
  565.    If you rename a registered file, you need to rename its master along
  566. with it (the command `vc-rename-file' does this automatically).  If you
  567. are using SCCS, you must also update the records of the snapshot, to
  568. mention the file by its new name (`vc-rename-file' does this, too).  An
  569. old snapshot that refers to a master file that no longer exists under
  570. the recorded name is invalid; VC can no longer retrieve it.  It would
  571. be beyond the scope of this manual to explain enough about RCS and SCCS
  572. to explain how to update the snapshots by hand.
  573.  
  574.    Using `vc-rename-file' makes the snapshot remain valid for
  575. retrieval, but it does not solve all problems.  For example, some of the
  576. files in the program probably refer to others by name.  At the very
  577. least, the makefile probably mentions the file that you renamed.  If you
  578. retrieve an old snapshot, the renamed file is retrieved under its new
  579. name, which is not the name that the makefile expects.  So the program
  580. won't really work as retrieved.
  581.  
  582. 
  583. File: xemacs.info,  Node: Version Headers,  Prev: Snapshots,  Up: Version Control
  584.  
  585. Inserting Version Control Headers
  586. ---------------------------------
  587.  
  588.    Sometimes it is convenient to put version identification strings
  589. directly into working files.  Certain special strings called "version
  590. headers" are replaced in each successive version by the number of that
  591. version.
  592.  
  593.    You can use the `C-x v h' command (`vc-insert-headers') to insert a
  594. suitable header string.
  595.  
  596. `C-x v h'
  597.      Insert headers in a file for use with your version-control system.
  598.  
  599.    The default header string is `\$Id\$' for RCS and `\%W\%' for SCCS.
  600. (The actual strings inserted do not have the backslashes in them.  They
  601. were placed in the Info source file so that the strings don't get
  602. interpreted as version-control headers when the Info source files are
  603. maintained under version control.) You can specify other headers to
  604. insert by setting the variable `vc-header-alist'.  Its value is a list
  605. of elements of the form `(PROGRAM . STRING)' where PROGRAM is `RCS' or
  606. `SCCS' and STRING is the string to use.
  607.  
  608.    Instead of a single string, you can specify a list of strings; then
  609. each string in the list is inserted as a separate header on a line of
  610. its own.
  611.  
  612.    It is often necessary to use "superfluous" backslashes when writing
  613. the strings that you put in this variable.  This is to prevent the
  614. string in the constant from being interpreted as a header itself if the
  615. Emacs Lisp file containing it is maintained with version control.
  616.  
  617.    Each header is inserted surrounded by tabs, inside comment
  618. delimiters, on a new line at the start of the buffer.  Normally the
  619. ordinary comment start and comment end strings of the current mode are
  620. used, but for certain modes, there are special comment delimiters for
  621. this purpose; the variable `vc-comment-alist' specifies them.  Each
  622. element of this list has the form `(MODE STARTER ENDER)'.
  623.  
  624.    The variable `vc-static-header-alist' specifies further strings to
  625. add based on the name of the buffer.  Its value should be a list of
  626. elements of the form `(REGEXP . FORMAT)'.  Whenever REGEXP matches the
  627. buffer name, FORMAT is inserted as part of the header.  A header line
  628. is inserted for each element that matches the buffer name, and for each
  629. string specified by `vc-header-alist'.  The header line is made by
  630. processing the string from `vc-header-alist' with the format taken from
  631. the element.  The default value for `vc-static-header-alist' is:
  632.  
  633.      (("\\.c$" .
  634.        "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
  635.      #endif /* lint */\n"))
  636.  
  637. which specifies insertion of a string of this form:
  638.  
  639.  
  640.      #ifndef lint
  641.      static char vcid[] = "STRING";
  642.      #endif /* lint */
  643.  
  644. 
  645. File: xemacs.info,  Node: ListDir,  Next: Comparing Files,  Prev: Version Control,  Up: Files
  646.  
  647. Listing a File Directory
  648. ========================
  649.  
  650.    Files are organized by Unix into "directories".  A "directory
  651. listing" is a list of all the files in a directory.  Emacs provides
  652. directory listings in brief format (file names only) and verbose format
  653. (sizes, dates, and authors included).
  654.  
  655. `C-x C-d DIR-OR-PATTERN'
  656.      Print a brief directory listing (`list-directory').
  657.  
  658. `C-u C-x C-d DIR-OR-PATTERN'
  659.      Print a verbose directory listing.
  660.  
  661.    To print a directory listing, use `C-x C-d' (`list-directory').
  662. This command prompts in the minibuffer for a file name which is either
  663. a  directory to be listed or pattern containing wildcards for the files
  664. to be listed.  For example,
  665.  
  666.      C-x C-d /u2/emacs/etc RET
  667.  
  668. lists all the files in directory `/u2/emacs/etc'.  An example of
  669. specifying a file name pattern is:
  670.  
  671.      C-x C-d /u2/emacs/src/*.c RET
  672.  
  673.    Normally, `C-x C-d' prints a brief directory listing containing just
  674. file names.  A numeric argument (regardless of value) tells it to print
  675. a verbose listing (like `ls -l').
  676.  
  677.    Emacs obtains the text of a directory listing by running `ls' in an
  678. inferior process.  Two Emacs variables control the switches passed to
  679. `ls': `list-directory-brief-switches' is a string giving the switches
  680. to use in brief listings (`"-CF"' by default).
  681. `list-directory-verbose-switches' is a string giving the switches to
  682. use in a verbose listing (`"-l"' by default).
  683.  
  684.    The variable `directory-abbrev-alist' is an alist of abbreviations
  685. for file directories.  The list consists of elements of the form `(FROM
  686. .  TO)', each meaning to replace `FROM' with `TO' when it appears in a
  687. directory name.  This replacement is done when setting up the default
  688. directory of a newly visited file.  Every `FROM' string should start
  689. with ``^''.
  690.  
  691.    Use this feature when you have directories which you normally refer
  692. to via absolute symbolic links.  Make `TO' the name of the link, and
  693. `FROM' the name it is linked to.
  694.  
  695. 
  696. File: xemacs.info,  Node: Comparing Files,  Next: Dired,  Prev: ListDir,  Up: Files
  697.  
  698. Comparing Files
  699. ===============
  700.  
  701.    The command `M-x diff' compares two files, displaying the
  702. differences in an Emacs buffer named `*Diff*'.  It works by running the
  703. `diff' program, using options taken from the variable `diff-switches',
  704. whose value should be a string.
  705.  
  706.    The buffer `*Diff*' has Compilation mode as its major mode, so you
  707. can use `C-x `' to visit successive changed locations in the two source
  708. files.  You can also move to a particular hunk of changes and type `C-c
  709. C-c' to find the corresponding source location.  You can also use the
  710. other special commands of Compilation mode: SPC and DEL for scrolling,
  711. and `M-p' and `M-n' for cursor motion.  *Note Compilation::.
  712.  
  713.    The command `M-x diff-backup' compares a specified file with its most
  714. recent backup.  If you specify the name of a backup file, `diff-backup'
  715. compares it with the source file that it is a backup of.
  716.  
  717.    The command `M-x compare-windows' compares the text in the current
  718. window with that in the next window.  Comparison starts at point in each
  719. window.  Point moves forward in each window, a character at a time in
  720. each window, until the next characters in the two windows are
  721. different.  Then the command is finished.  For more information about
  722. windows in Emacs, *Note Windows::.
  723.  
  724.    With a numeric argument, `compare-windows' ignores changes in
  725. whitespace.  If the variable `compare-ignore-case' is non-`nil', it
  726. ignores differences in case as well.
  727.  
  728. 
  729. File: xemacs.info,  Node: Dired,  Next: Misc File Ops,  Prev: Comparing Files,  Up: Files
  730.  
  731. Dired, the Directory Editor
  732. ===========================
  733.  
  734.    Dired makes it easy to delete or visit many of the files in a single
  735. directory at once.  It creates an Emacs buffer containing a listing of
  736. the directory.  You can use the normal Emacs commands to move around in
  737. this buffer and special Dired commands to operate on the files.
  738.  
  739. * Menu:
  740.  
  741. * Enter: Dired Enter.         How to invoke Dired.
  742. * Edit: Dired Edit.           Editing the Dired buffer.
  743. * Deletion: Dired Deletion.   Deleting files with Dired.
  744. * Immed: Dired Immed.         Other file operations through Dired.
  745.  
  746. 
  747. File: xemacs.info,  Node: Dired Enter,  Next: Dired Edit,  Prev: Dired,  Up: Dired
  748.  
  749. Entering Dired
  750. --------------
  751.  
  752.    To invoke dired, type `C-x d' or `M-x dired'.  The command reads a
  753. directory name or wildcard file name pattern as a minibuffer argument
  754. just like the `list-directory' command, `C-x C-d'.  Where `dired'
  755. differs from `list-directory' is in naming the buffer after the
  756. directory name or the wildcard pattern used for the listing, and putting
  757. the buffer into Dired mode so that the special commands of Dired are
  758. available in it.  The variable `dired-listing-switches' is a string
  759. used as an argument to `ls' in making the directory; this string must
  760. contain `-l'.
  761.  
  762.    To display the Dired buffer in another window rather than in the
  763. selected window, use `C-x 4 d' (`dired-other-window)' instead of `C-x
  764. d'.
  765.  
  766. 
  767. File: xemacs.info,  Node: Dired Edit,  Next: Dired Deletion,  Prev: Dired Enter,  Up: Dired
  768.  
  769. Editing in Dired
  770. ----------------
  771.  
  772.    Once the Dired buffer exists, you can switch freely between it and
  773. other Emacs buffers.  Whenever the Dired buffer is selected, certain
  774. special commands are provided that operate on files that are listed.
  775. The Dired buffer is "read-only", and inserting text in it is not
  776. useful, so ordinary printing characters such as `d' and `x' are used
  777. for Dired commands.  Most Dired commands operate on the file described
  778. by the line that point is on.  Some commands perform operations
  779. immediately; others "flag" a file to be operated on later.
  780.  
  781.    Most Dired commands that operate on the current line's file also
  782. treat a numeric argument as a repeat count, meaning to act on the files
  783. of the next few lines.  A negative argument means to operate on the
  784. files of the preceding lines, and leave point on the first of those
  785. lines.
  786.  
  787.    All the usual Emacs cursor motion commands are available in Dired
  788. buffers.  Some special purpose commands are also provided.  The keys
  789. `C-n' and `C-p' are redefined so that they try to position the cursor
  790. at the beginning of the filename on the line, rather than at the
  791. beginning of the line.
  792.  
  793.    For extra convenience, SPC and `n' in Dired are equivalent to `C-n'.
  794. `p' is equivalent to `C-p'.  Moving by lines is done so often in Dired
  795. that it deserves to be easy to type.  DEL (move up and unflag) is often
  796. useful simply for moving up.
  797.  
  798.    The `g' command in Dired runs `revert-buffer' to reinitialize the
  799. buffer from the actual disk directory and show any changes made in the
  800. directory by programs other than Dired.  All deletion flags in the Dired
  801. buffer are lost when this is done.
  802.  
  803. 
  804. File: xemacs.info,  Node: Dired Deletion,  Next: Dired Immed,  Prev: Dired Edit,  Up: Dired
  805.  
  806. Deleting Files With Dired
  807. -------------------------
  808.  
  809.    The primary use of Dired is to flag files for deletion and then
  810. delete them.
  811.  
  812. `d'
  813.      Flag this file for deletion.
  814.  
  815. `u'
  816.      Remove deletion-flag on this line.
  817.  
  818. `DEL'
  819.      Remove deletion-flag on previous line, moving point to that line.
  820.  
  821. `x'
  822.      Delete the files that are flagged for deletion.
  823.  
  824. `#'
  825.      Flag all auto-save files (files whose names start and end with `#')
  826.      for deletion (*note Auto Save::.).
  827.  
  828. `~'
  829.      Flag all backup files (files whose names end with `~') for deletion
  830.      (*note Backup::.).
  831.  
  832. `. (Period)'
  833.      Flag excess numeric backup files for deletion.  The oldest and
  834.      newest few backup files of any one file are exempt; the middle
  835.      ones are flagged.
  836.  
  837.    You can flag a file for deletion by moving to the line describing the
  838. file and typing `d' or `C-d'.  The deletion flag is visible as a `D' at
  839. the beginning of the line.  Point is moved to the beginning of the next
  840. line, so that repeated `d' commands flag successive files.
  841.  
  842.    The files are flagged for deletion rather than deleted immediately to
  843. avoid the danger of deleting a file accidentally.  Until you direct
  844. Dired to delete the flagged files, you can remove deletion flags using
  845. the commands `u' and DEL.  `u' works just like `d', but removes flags
  846. rather than making flags.  DEL moves upward, removing flags; it is like
  847. `u' with numeric argument automatically negated.
  848.  
  849.    To delete the flagged files, type `x'.  This command first displays a
  850. list of all the file names flagged for deletion, and requests
  851. confirmation with `yes'.  Once you confirm, all the flagged files are
  852. deleted, and their lines are deleted from the text of the Dired buffer.
  853. The shortened Dired buffer remains selected.  If you answer `no' or
  854. quit with `C-g', you return immediately to Dired, with the deletion
  855. flags still present and no files actually deleted.
  856.  
  857.    The `#', `~', and `.' commands flag many files for deletion, based
  858. on their names.  These commands are useful precisely because they do
  859. not actually delete any files; you can remove the deletion flags from
  860. any flagged files that you really wish to keep.
  861.  
  862.    `#' flags for deletion all files that appear to have been made by
  863. auto-saving (that is, files whose names begin and end with `#').  `~'
  864. flags for deletion all files that appear to have been made as backups
  865. for files that were edited (that is, files whose names end with `~').
  866.  
  867.    `.' (Period) flags just some of the backup files for deletion: only
  868. numeric backups that are not among the oldest few nor the newest few
  869. backups of any one file.  Normally `dired-kept-versions' (not
  870. `kept-new-versions'; that applies only when saving) specifies the
  871. number of newest versions of each file to keep, and `kept-old-versions'
  872. specifies the number of oldest versions to keep.  Period with a
  873. positive numeric argument, as in `C-u 3 .', specifies the number of
  874. newest versions to keep, overriding `dired-kept-versions'.  A negative
  875. numeric argument overrides `kept-old-versions', using minus the value
  876. of the argument to specify the number of oldest versions of each file
  877. to keep.
  878.  
  879. 
  880. File: xemacs.info,  Node: Dired Immed,  Prev: Dired Deletion,  Up: Dired
  881.  
  882. Immediate File Operations in Dired
  883. ----------------------------------
  884.  
  885.    Some file operations in Dired take place immediately when they are
  886. requested.
  887.  
  888. `c'
  889.      Copies the file described on the current line.  You must supply a
  890.      file name to copy to, using the minibuffer.
  891.  
  892. `f'
  893.      Visits the file described on the current line.  It is just like
  894.      typing `C-x C-f' and supplying that file name.  If the file on
  895.      this line is a subdirectory, `f' actually causes Dired to be
  896.      invoked on that subdirectory.  *Note Visiting::.
  897.  
  898. `o'
  899.      Like `f', but uses another window to display the file's buffer.
  900.      The Dired buffer remains visible in the first window.  This is
  901.      like using `C-x 4 C-f' to visit the file.  *Note Windows::.
  902.  
  903. `r'
  904.      Renames the file described on the current line.  You must supply a
  905.      file name to rename to, using the minibuffer.
  906.  
  907. `v'
  908.      Views the file described on this line using `M-x view-file'.
  909.      Viewing a file is like visiting it, but is slanted toward moving
  910.      around in the file conveniently and does not allow changing the
  911.      file.  *Note View File: Misc File Ops.  Viewing a file that is a
  912.      directory runs Dired on that directory.
  913.  
  914. 
  915. File: xemacs.info,  Node: Misc File Ops,  Prev: Dired,  Up: Files
  916.  
  917. Miscellaneous File Operations
  918. =============================
  919.  
  920.    Emacs has commands for performing many other operations on files.
  921. All operate on one file; they do not accept wildcard file names.
  922.  
  923.    You can use the command `M-x add-name-to-file' to add a name to an
  924. existing file without removing the old name.  The new name must belong
  925. on the file system that the file is on.
  926.  
  927.    `M-x append-to-file' adds the text of the region to the end of the
  928. specified file.
  929.  
  930.    `M-x copy-file' reads the file OLD and writes a new file named NEW
  931. with the same contents.  Confirmation is required if a file named NEW
  932. already exists, because copying overwrites the old contents of the file
  933. NEW.
  934.  
  935.    `M-x delete-file' deletes a specified file, like the `rm' command in
  936. the shell.  If you are deleting many files in one directory, it may be
  937. more convenient to use Dired (*note Dired::.).
  938.  
  939.    `M-x insert-file' inserts a copy of the contents of a specified file
  940. into the current buffer at point, leaving point unchanged before the
  941. contents and the mark after them.  *Note Mark::.
  942.  
  943.    `M-x make-symbolic-link' reads two file names OLD and LINKNAME, and
  944. then creates a symbolic link named LINKNAME and pointing at OLD.
  945. Future attempts to open file LINKNAME will then refer to the file named
  946. OLD at the time the opening is done, or will result in an error if the
  947. name OLD is not in use at that time.  Confirmation is required if you
  948. create the link while LINKNAME is in use.  Note that not all systems
  949. support symbolic links.
  950.  
  951.    `M-x rename-file' reads two file names OLD and NEW using the
  952. minibuffer, then renames file OLD as NEW.  If a file named NEW already
  953. exists, you must confirm with `yes' or renaming is not done; this is
  954. because renaming causes the previous meaning of the name NEW to be
  955. lost.  If OLD and NEW are on different file systems, the file OLD is
  956. copied and deleted.
  957.  
  958.    `M-x view-file' allows you to scan or read a file by sequential
  959. screenfuls.  It reads a file name argument using the minibuffer.  After
  960. reading the file into an Emacs buffer, `view-file' reads and displays
  961. one windowful.  You can then type SPC to scroll forward one window, or
  962. DEL to scroll backward.  Various other commands are provided for moving
  963. around in the file, but none for changing it; type `C-h' while viewing
  964. a file for a list of them.  Most commands are the default Emacs cursor
  965. motion commands.  To exit from viewing, type `C-c'.
  966.  
  967. 
  968. File: xemacs.info,  Node: Buffers,  Next: Windows,  Prev: Files,  Up: Top
  969.  
  970. Using Multiple Buffers
  971. **********************
  972.  
  973.    Text you are editing in Emacs resides in an object called a
  974. "buffer".  Each time you visit a file, Emacs creates a buffer to hold
  975. the file's text.  Each time you invoke Dired, Emacs creates a buffer to
  976. hold the directory listing.  If you send a message with `C-x m', a
  977. buffer named `*mail*' is used to hold the text of the message.  When
  978. you ask for a command's documentation, it appears in a buffer called
  979. `*Help*'.
  980.  
  981.    At any time, one and only one buffer is "selected".  It is also
  982. called the "current buffer".  Saying a command operates on "the buffer"
  983. really means that the command operates on the selected buffer, as most
  984. commands do.
  985.  
  986.    When Emacs creates multiple windows, each window has a chosen buffer
  987. which is displayed there, but at any time only one of the windows is
  988. selected and its chosen buffer is the selected buffer.  Each window's
  989. mode line displays the name of the buffer the window is displaying
  990. (*note Windows::.).
  991.  
  992.    Each buffer has a name which can be of any length but is
  993. case-sensitive.  You can select a buffer using its name.  Most buffers
  994. are created when you visit files; their names are derived from the
  995. files' names.  You can also create an empty buffer with any name you
  996. want.  A newly started Emacs has a buffer named `*scratch*' which you
  997. can use for evaluating Lisp expressions in Emacs.
  998.  
  999.    Each buffer records what file it is visiting, whether it is
  1000. modified, and what major mode and minor modes are in effect in it
  1001. (*note Major Modes::.).  Any Emacs variable can be made "local to" a
  1002. particular buffer, meaning its value in that buffer can be different
  1003. from the value in other buffers.  *Note Locals::.
  1004.  
  1005. * Menu:
  1006.  
  1007. * Select Buffer::   Creating a new buffer or reselecting an old one.
  1008. * List Buffers::    Getting a list of buffers that exist.
  1009. * Misc Buffer::     Renaming; changing read-onliness; copying text.
  1010. * Kill Buffer::     Killing buffers you no longer need.
  1011. * Several Buffers:: How to go through the list of all buffers
  1012.                      and operate variously on several of them.
  1013.  
  1014. 
  1015. File: xemacs.info,  Node: Select Buffer,  Next: List Buffers,  Prev: Buffers,  Up: Buffers
  1016.  
  1017. Creating and Selecting Buffers
  1018. ==============================
  1019.  
  1020. `C-x b BUFFER RET'
  1021.      Select or create a buffer named BUFFER (`switch-to-buffer').
  1022.  
  1023. `C-x 4 b BUFFER RET'
  1024.      Similar, but select a buffer named BUFFER in another window
  1025.      (`switch-to-buffer-other-window').
  1026.  
  1027. `M-x switch-to-other-buffer N'
  1028.      Switch to the previous buffer.
  1029.  
  1030.    To select a buffer named BUFNAME, type `C-x b BUFNAME RET'.  This is
  1031. the command `switch-to-buffer' with argument BUFNAME.  You can use
  1032. completion on an abbreviation for the buffer name you want (*note
  1033. Completion::.).  An empty argument to `C-x b' specifies the most
  1034. recently selected buffer that is not displayed in any window.
  1035.  
  1036.    Most buffers are created when you visit files, or use Emacs commands
  1037. that display text.  You can also create a buffer explicitly by typing
  1038. `C-x b BUFNAME RET', which creates a new, empty buffer that is not
  1039. visiting any file, and selects it for editing.  The new buffer's major
  1040. mode is determined by the value of `default-major-mode' (*note Major
  1041. Modes::.).  Buffers not visiting files are usually used for making
  1042. notes to yourself.  If you try to save one, you are asked for the file
  1043. name to use.
  1044.  
  1045.    The function `switch-to-buffer-other-frame' is similar to
  1046. `switch-to-buffer' except that it creates a new frame in which to
  1047. display the selected buffer.
  1048.  
  1049.    Use `M-x switch-to-other-buffer' to visit the previous buffer. If
  1050. you supply a positive integer N, the Nth most recent buffer is
  1051. displayed. If you supply an argument of 0, the current buffer is moved
  1052. to the bottom of the buffer stack.
  1053.  
  1054.    Note that you can also use `C-x C-f' and any other command for
  1055. visiting a file to switch buffers.  *Note Visiting::.
  1056.  
  1057. 
  1058. File: xemacs.info,  Node: List Buffers,  Next: Misc Buffer,  Prev: Select Buffer,  Up: Buffers
  1059.  
  1060. Listing Existing Buffers
  1061. ========================
  1062.  
  1063. `C-x C-b'
  1064.      List the existing buffers (`list-buffers').
  1065.  
  1066.    To print a list of all existing buffers, type `C-x C-b'.  Each line
  1067. in the list shows one buffer's name, major mode, and visited file.  A
  1068. `*' at the beginning of a line indicates the buffer has been
  1069. "modified".  If several buffers are modified, it may be time to save
  1070. some with `C-x s' (*note Saving::.).  A `%' indicates a read-only
  1071. buffer.  A `.' marks the selected buffer.  Here is an example of a
  1072. buffer list:
  1073.  
  1074.       MR Buffer         Size  Mode           File
  1075.       -- ------         ----  ----           ----
  1076.      .*  emacs.tex      383402 Texinfo       /u2/emacs/man/emacs.tex
  1077.          *Help*         1287  Fundamental
  1078.          files.el       23076 Emacs-Lisp     /u2/emacs/lisp/files.el
  1079.        % RMAIL          64042 RMAIL          /u/rms/RMAIL
  1080.       *% man            747   Dired        /u2/emacs/man/
  1081.          net.emacs      343885 Fundamental   /u/rms/net.emacs
  1082.          fileio.c       27691 C              /u2/emacs/src/fileio.c
  1083.          NEWS           67340 Text           /u2/emacs/etc/NEWS
  1084.          *scratch*       0     Lisp Interaction
  1085.  
  1086. Note that the buffer `*Help*' was made by a help request; it is not
  1087. visiting any file.  The buffer `man' was made by Dired on the directory
  1088. `/u2/emacs/man/'.
  1089.  
  1090.    As you move the mouse over the `*Buffer List*' buffer, the lines are
  1091. highlighted.  This visual cue indicates that clicking the right mouse
  1092. button (`button3') will pop up a menu of commands on the buffer
  1093. represented by this line.  This menu duplicates most of those commands
  1094. which are bound to keys in the `*Buffer List*' buffer.
  1095.  
  1096. 
  1097. File: xemacs.info,  Node: Misc Buffer,  Next: Kill Buffer,  Prev: List Buffers,  Up: Buffers
  1098.  
  1099. Miscellaneous Buffer Operations
  1100. ===============================
  1101.  
  1102. `C-x C-q'
  1103.      Toggle read-only status of buffer (`toggle-read-only').
  1104.  
  1105. `M-x rename-buffer'
  1106.      Change the name of the current buffer.
  1107.  
  1108. `M-x view-buffer'
  1109.      Scroll through a buffer.
  1110.  
  1111.    A buffer can be "read-only", which means that commands to change its
  1112. text are not allowed.  Normally, read-only buffers are created by
  1113. subsystems such as Dired and Rmail that have special commands to operate
  1114. on the text.  Emacs also creates a read-only buffer if you visit a file
  1115. that is protected.  To make changes in a read-only buffer, use the
  1116. command `C-x C-q' (`toggle-read-only').  It makes a read-only buffer
  1117. writable, and makes a writable buffer read-only.  This works by setting
  1118. the variable `buffer-read-only', which has a local value in each buffer
  1119. and makes a buffer read-only if its value is non-`nil'.
  1120.  
  1121.    `M-x rename-buffer' changes the name of the current buffer,
  1122. prompting for the new name in the minibuffer.  There is no default.  If
  1123. you specify a name that is used by a different buffer, an error is
  1124. signalled and renaming is not done.
  1125.  
  1126.    `M-x view-buffer' is similar to `M-x view-file' (*note Misc File
  1127. Ops::.), but it examines an already existing Emacs buffer.  View mode
  1128. provides convenient commands for scrolling through the buffer but not
  1129. for changing it.  When you exit View mode, the resulting value of point
  1130. remains in effect.
  1131.  
  1132.    To copy text from one buffer to another, use the commands `M-x
  1133. append-to-buffer' and `M-x insert-buffer'.  *Note Accumulating Text::.
  1134.  
  1135. 
  1136. File: xemacs.info,  Node: Kill Buffer,  Next: Several Buffers,  Prev: Misc Buffer,  Up: Buffers
  1137.  
  1138. Killing Buffers
  1139. ===============
  1140.  
  1141.    After using Emacs for a while, you may accumulate a large number of
  1142. buffers and may want to eliminate the ones you no longer need.  There
  1143. are several commands for doing this.
  1144.  
  1145. `C-x k'
  1146.      Kill a buffer, specified by name (`kill-buffer').
  1147.  
  1148. `M-x kill-some-buffers'
  1149.      Offer to kill each buffer, one by one.
  1150.  
  1151.    `C-x k' (`kill-buffer') kills one buffer, whose name you specify in
  1152. the minibuffer.  If you type just RET in the minibuffer, the default,
  1153. killing the current buffer, is used.  If the current buffer is killed,
  1154. the buffer that has been selected recently but does not appear in any
  1155. window now is selected.  If the buffer being killed contains unsaved
  1156. changes, you are asked to confirm with `yes' before the buffer is
  1157. killed.
  1158.  
  1159.    The command `M-x kill-some-buffers' asks about each buffer, one by
  1160. one.  An answer of `y' means to kill the buffer.  Killing the current
  1161. buffer or a buffer containing unsaved changes selects a new buffer or
  1162. asks for confirmation just like `kill-buffer'.
  1163.  
  1164.